package com.sj.uabrowser.mvp.main.view.adp;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sj.uabrowser.R;
import com.sj.uabrowser.mvp.main.bean.MainNewFuncs;
import com.sj.uabrowser.net.bean.MainFunc;

import java.util.List;


public class FuncsAdp extends BaseQuickAdapter<MainNewFuncs.AdListBean, BaseViewHolder> {

    public FuncsAdp(int layoutResId, @Nullable List<MainNewFuncs.AdListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MainNewFuncs.AdListBean item) {
//        helper.setImageResource(R.id.iv_func,item.getResId());
        Glide.with(mContext)
                .load(item.getIcon())
                .apply(new RequestOptions().placeholder(R.drawable.shape_func_err).error(R.drawable.shape_func_err))
                .into((ImageView) helper.getView(R.id.iv_func));
        helper.setText(R.id.tv_title,item.getTitle());
    }
}
